<br>
<h3>评论</h3>
<div class="comment-area" id="comments">

	<hr>
	<form class="form-horizontal comment-form" action="{:U('comment/comment/post_zhl')}" method="post">
		<div class="control-group">
			<div class="comment-postbox-wraper">
				<textarea class="form-control comment-postbox" placeholder="" style="min-height:90px;min-width: 300px;width:100%" name="content"></textarea>
			</div>
		</div>

		<div class="control-group">
			<button type="submit" class="btn pull-right btn-primary js-ajax-submit" style="float: right;margin-bottom: 13px;padding: 7px 9px;"><i class="fa fa-comment-o"></i> 发表评论</button>
		</div>

		<input type="hidden" name="post_title" value="{$params.post_title}" />
		<input type="hidden" name="post_table" value="{$post_table}" />
		<input type="hidden" name="post_id" value="{$post_id}" />
		<input type="hidden" name="a_id" value="{$_GET['id']}" />
		<input type="hidden" name="to_uid" value="0" />
		<input type="hidden" name="parentid" value="0" />
	</form>

	<hr>
	<div class="comments">
		<foreach name="comments" item="vo"  key="k">
			<div class="comment">
				<a class="pull-left" href="{:U('user/index/index',array('id'=>$vo['uid']))}">
		    <img  src="{:U('user/public/avatar',array('id'=>$vo['uid']))}"   class="pl_touxiang" />
		  </a>
				<div class="comment-body">
					<div class="comment-content">
						<a href="{:U('user/index/index',array('id'=>$vo['uid']))}">
							{$vo.full_name}</a>&nbsp;:&nbsp;<span>{$vo.content}</span>
					</div>
					<div>
						<span class="time">{:date('m月d日  H:i',strtotime($vo['createtime']))}</span> 
						<a onclick="comment_reply({$k});" href="javascript:;">回复</a>
					</div>
					<form class="form-horizontal comment-form" action="{:U('comment/comment/post_zhl')}" method="post">
						<div class="huifu a{$k}">
							<div class="in_hf">
								<input type="text" placeholder="回复" class="t_hf" name="content">
								<input type="hidden" name="post_title" value="{$params.post_title}" />
								<input type="hidden" name="post_table" value="{$post_table}" />
								<input type="hidden" name="post_id" value="{$post_id}" />
								<input type="hidden" name="to_uid" value="{$vo['uid']}" />
								<input type="hidden" name="parentid" value="{$vo['id']}" />
								<input type="hidden" name="a_id" value="{$_GET['id']}" />

							</div>
							<input type="submit" class="huifu_bth" name="回复" />
						</div>
					</form>
					<if condition="!empty($vo['children'])">
						<foreach name="vo.children" item="voo" key="kk">
							<div class="comment">
								<a class="pull-left" href="{:U('user/index/index',array('id'=>$voo['uid']))}">
					    			<img  src="{:U('user/public/avatar',array('id'=>$voo['uid']))}" class="pl_touxiang"/>
					  			</a>
								<div class="comment-body">
									<div class="comment-content">
										<a href="{:U('user/index/index',array('id'=>$voo['uid']))}">
											{$voo.full_name}</a>:
											<span>回复 <a href="{:U('user/index/index',array('id'=>$voo['to_uid']))}">{$parent_comments[$voo['parentid']]['full_name']}</a> 
												{$voo.content}</span>
									</div>
									<div>
										<span class="time">{:date('m月d日  H:i',strtotime($voo['createtime']))}</span> 
										<a onclick="comment_reply_b({$kk});" href="javascript:;">回复</a>
									</div>
									<form class="form-horizontal comment-form" action="{:U('comment/comment/post_zhl')}" method="post">
										<div class="huifu b{$kk}">
											<div class="in_hf">
												<input type="text" placeholder="回复" class="t_hf" name="content">
												<input type="hidden" name="post_title" value="{$params.post_title}" />
												<input type="hidden" name="post_table" value="{$post_table}" />
												<input type="hidden" name="post_id" value="{$post_id}" />
												<input type="hidden" name="to_uid" value="{$voo['uid']}" />
												<input type="hidden" name="parentid" value="{$voo['id']}" />
												<input type="hidden" name="a_id" value="{$_GET['id']}" />
										
											</div>
											<input type="submit" class="huifu_bth" name="回复" />
										</div>
									</form>
								</div>
								<div class="clearfix"></div>
							</div>
						</foreach>

					</if>
				
				</div>
				<div class="clearfix"></div>
			</div>
		</foreach>
	</div>

</div>
<script type="text/javascript">
	function comment_reply(a) {
		$(".huifu").hide();
		$(".a"+a).show();
		
	}
	function comment_reply_b(b) {
		$(".huifu").hide();
		$(".b"+b).show();
	}
</script>